package org.openscheduler.modules.scheduler;

import java.util.List;

import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerContext;
import org.quartz.SchedulerException;

public class SchedulerWrapper {

	private Scheduler scheduler;

	public Scheduler getScheduler() {
		return scheduler;
	}
	
	private List<JobDetail> jobDetails;

	public List<JobDetail> getJobDetails() {
		return jobDetails;
	}

	public void setJobDetails(List<JobDetail> jobDetails) {
		this.jobDetails = jobDetails;
	}

	public SchedulerWrapper(Scheduler scheduler) {
		if (scheduler == null) {
			throw new IllegalArgumentException("Scheduler is null");
		}
		this.scheduler = scheduler;
	}
	
	public SchedulerContext getContext() throws SchedulerException {
		return scheduler.getContext();
	}
	
	public SchedulerMetaDataWrapper getMetaData() throws SchedulerException {
		return new SchedulerMetaDataWrapper(scheduler.getMetaData());
	}
	
}
